<%--
  Created by IntelliJ IDEA.
  User: www10
  Date: 2022/4/16
  Time: 15:38
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title>2成功页面2</title>
</head>
    <script src="${pageContext.request.contextPath}/resource/js/jquery-3.6.0/jquery-3.6.0.js"></script>
    <link rel="stylesheet" type="text/css" href="https://www.layuicdn.com/layui/css/layui.css" />
    <script src="https://www.layuicdn.com/layui/layui.js"></script>
<body>
            <h3>WHAT FUCK</h3>
            <div>

            </div>



    <button class="layui-btn"  lay-filter="test">立即提交</button>

            <button type="button" class="layui-btn" id="test1">
                <i class="layui-icon">&#xe67c;</i>上传图片
            </button>

</body>
    <script type="text/javascript"></script>
    <script>

        layui.use(['form', 'upload'], function(){  //如果只加载一个模块，可以不填数组。如：layui.use('form')
            var form = layui.form
            var upload=layui.upload;

            //监听提交按钮
            form.on('submit(test)', function(data){
                console.log(data);
                console.log("123")
            });

            //实例化一个上传控件
            upload.render({
                elem:'#test1',
                url:'/ftp/upload',
                async:false,
                before:function(){
                    loading  = layer.msg('正在上传', {icon:16, shade:0.3, time:0});
                },
                done:function (res, index, upload) {
                    layer.close(loading)
                    console.log(res)
                }
            })
        });
    </script>
</html>
